package com.lvy.hczn.transmit.controller.unuse;

import com.lvy.hczn.front.common.core.domain.AjaxResult;
import com.lvy.hczn.front.common.exception.UtilException;
import com.lvy.hczn.front.system.domain.business.WarehousingEntry;
import com.lvy.hczn.mq.rocket.ParamInfo;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * 入库单
 *
 * @author yw
 * @date 2023-05-06 16:54:48
 **/
@RequestMapping("/api/dt/order/")
@RestController
@Slf4j
public class WarehousingEntryController {

    /**
     * 空箱铺箱入库单
     *
     * @param info
     * @return
     */
    @ApiOperation(value = "空箱铺箱入库单", notes = "空箱铺箱入库单")
    @PostMapping("empty/box")
    public AjaxResult emptyBox(HttpServletRequest request, @RequestBody ParamInfo<WarehousingEntry> info) {
        try {
            return AjaxResult.success();
        } catch (Exception e) {
            if (e instanceof UtilException) {
                return AjaxResult.error(e.getMessage());
            } else {
                log.error("rejected同步异常：{}", e);
                return AjaxResult.error("系统异常");
            }
        }
    }
}
